package com.yuezhu.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.yuezhu.R;
import com.yuezhu.global.ApplicationContext;

/**
 * Created by 健 on 2016/5/20.
 */
public class MoreAppAdapter extends BaseAdapter {

    private  int count;
    private Context context;
    //侧滑菜单显示内容
    private String[] listDatas = new String[]{"电梯速算助手", "关于", "更多应用", "账户", "退出"};

    public MoreAppAdapter(Context context,int count) {
        this.count=count;
        this.context = context;
    }

    @Override
    public int getCount() {
        return count;
    }

    @Override
    public Object getItem(int position) {

        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null) {
            convertView = View.inflate(ApplicationContext.getContext(), R.layout.item_gridview, null);
            holder = new ViewHolder(convertView, position);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        return convertView;
    }

    static class ViewHolder {
        ImageView iv_icon;
        TextView tv_title;

        public ViewHolder(View convertView, int position) {
            iv_icon = (ImageView) convertView.findViewById(R.id.iv_app_icon);
            tv_title = (TextView) convertView.findViewById(R.id.tv_app_name);
        }
    }
}
